package com.xiaoxu.intranetweb.mybatisplusSzappdb.controller.ashGate;

import cn.dev33.satoken.stp.StpUtil;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.business.ashGate.AshGateAdvancedBu;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.dao.UserInfoDao;
import com.xiaoxu.intranetweb.util.PermissionCheck;
import com.xiaoxu.intranetweb.util.SzResult;
import com.xiaoxu.intranetweb.util.WebFunctionUtil;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping(value = "/ashGateAdvance")
public class AshGateAdvanceController {
    @Autowired
    private  AshGateAdvancedBu ashGateAdvancedBu;
    @Autowired
    private UserInfoDao userInfoDao;
    @Autowired
    private WebFunctionUtil webFunctionUtil;
    @GetMapping("/ashGateAdvance")
    @PermissionCheck("ashGate_ashGateAdvance")
    //String id, String ManualGateStatus, String ManualGateHighAndManStatus, String token
    public SzResult ashGateAdvance(@RequestParam String id,
                                   @RequestParam (value = "ManualGateStatus", required = false)String ManualGateStatus,
                                   @RequestParam (value = "ManualGateHigh", required = false)String ManualGateHigh,
                                   HttpServletRequest request) throws Exception {
        String token = request.getHeader("Authorization");
        String plantId = request.getHeader("Plant-Id");
        return ashGateAdvancedBu.ashGateAdvanced(id,ManualGateStatus,ManualGateHigh,token,plantId);
    }
}
